<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ page import="org.springframework.web.util.UrlPathHelper"%>  
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="css/board.css" />
<title>Insert title here</title>
</head>
<body>

<%
UrlPathHelper urlPathHelper = new UrlPathHelper();
String endUrl = urlPathHelper.getOriginatingRequestUri(request);
session.setAttribute("url", endUrl);
%>

	<div id='boardFrm' align="center">
		<!-- 상단 타이틀 이미지 -->
		<div align="left" style = "margin-bottom: 20px; margin-top: 20px">
			<img src="images/review/user_rv.gif" />
		</div>
			<div style="text-align: right; font-family: 맑은 고딕; 
			font-size: 12px; color:#BDBDBD; margin-bottom: 10px;">
			페이지 : ${page}&nbsp; of &nbsp;${totalPage}
			</div>

		<!-- 게시판 타이틀 -->
		<div class='board_title'>
			<span style="width: 5%;">NO</span> <span style="width: 60%;">제목</span>
			<span style="width: 20%;">작성일</span> <span style="width: 10%;">조회수</span>
		</div>

		<c:if test="${cnt == 0}">
			<div>
				<span style="width: 95%;">등록된 게시글이 없습니다.</span>
			</div>
		</c:if>

		<!-- 게시글 -->
		<c:if test="${cnt > 0}">
			<c:forEach var="board" items="${userReviewBoards}">

				<div class='list_frm'>
					<span style="width: 5%;">${board.idx}</span> <a
						href="review_detail.do"><span style="width: 60%;">${board.title}</span></a>
					<span style="width: 20%;"><fmt:formatDate
							value="${board.wdate}" pattern="yyyy-MM-dd" /></span> <span
						style="width: 10%;">${board.read_count}</span>
				</div>


			</c:forEach>
		</c:if>
	</div>
	
			<!-- 페이징 -->
		<div id = 'paging' align = 'center'>
		<c:if test="${page > 1}"><a href="index?page=1">&lt;&lt;첫 페이지</a></c:if>&nbsp;
		<c:if test="${page > 2}"><a href="index?page=${page-1 }">&lt;이전 페이지</a></c:if>&nbsp;
		<c:if test="${page < lastPage-1}"><a href="index?page=${page+1 }">다음 페이지&gt;</a></c:if>&nbsp;
		<c:if test="${page < lastPage}"><a href="index?page=${lastPage }">마지막 페이지&gt;&gt;</a></c:if>&nbsp;	
		</div>

		<!-- 글쓰기 버튼 -->
		<div align="center" style = "margin-left: 900px">
			<input class = "findBtn" style = "width: 100px;" 
			type="button" value="새 글 쓰기" onclick="location.href='ur_write.do?page=${page}&action=new'" />
		</div>

		<!-- 글 검색 -->
		<div id='notice_find' align="center">
			<fieldset
				style="border: 1px solid #EAEAEA; background: #F6F6F6; width: 300px; padding: 10px;">
				<label style="margin-right: 5px; font-weight: bold;">제목</label> <input
					type='text' id='findStr' style="width: 160px; height: 25px;" /> <input
					type='button' class='findBtn' value='검색' />
			</fieldset>		
		</div>
</body>
</html>